package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * 最后运行状态枚举类
 * @author Administrator
 *
 */
@Getter
public enum LastRunState {

	FAIL(0, "失败"),
	SUCCESS(1, "成功"),
	RUNNING(2, "运行中"),
	NOTRUN(3, "未启动"),
	NOTFINISH(4,"由于其他节点失败导致未完成"),
	STOP(5,"停止"),;

	int code;
	String name;

	LastRunState(int code, String message) {
		this.code = code;
		this.name = message;
	}


	public static LastRunState ObjOf(Integer code) {
		if (code == null) {
			code = 1;
		}
		for (LastRunState s : LastRunState.values()) {
			if (s.getCode() == code) {
				return s;
			}
		}
		return null;
	}
}
